
window.onload = function(argument) {
    $("#headerCon").addClass("header_active_1")
    $("#screenOneMain").addClass("1__heading_animate_init");
    $("#screenOnePhone").addClass("1__phone_animate_init");
    $("#screenOneShadow").addClass("1__shadow_animate_init");
    // screen 2 init
    $("#srceenTwoMain").addClass("screen-2__heading_animate_init");
    $("#srceenTwoSub").addClass("screen-2__subheading_animate_init");
    $("#srceenTwoPhone").addClass("screen-2__phone_animate_init");
    $("#srceenThreeMain").addClass("screen-3__heading_animate_init")
    $("#srceenThreeSub").addClass("screen-3__subheading_animate_init")
    $("#srceenThreePhone").addClass("screen-3__phone_animate_init")
    $("#srceenThreeItems").addClass("screen-3__features_animate_init")

    $("#srceenFourMain").addClass("screen-4__heading_animate_init")
    $("#srceenFourSub").addClass("screen-4__subheading_animate_init")
    $("#srceenFourType").addClass("screen-4__type_animate_init")
    
    $("#srceenFiveMain").addClass("screen-5__heading_animate_init")
    $("#srceenFiveSub").addClass("screen-5__heading_animate_init")
    $("#srceenFiveBack").addClass("screen-5__back_animate_init")

    setTimeout(function() {
        $("#screenOneMain,#screenOnePhone,#screenOneShadow").css("visibility","visible")
        $("#screenOneMain").addClass("screen-1__heading_animate_done");
        $("#screenOnePhone").addClass("screen-1__phone_animate_done");
        $("#screenOneShadow").addClass("screen-1__shadow_animate_done");
    }, 500)
}

$(window).scroll(function(){
    var top = $("body").scrollTop();
    if (top < 100) {
        $("#headerCon").removeClass("header_status_black")
    } else {
        $("#headerCon").addClass("header_status_black")
    }
    if (top < 400) {
        $("#sideNavCon").css({"opacity":0})
    } else {
        $("#sideNavCon").css({"opacity":1})   
    }

    if (top > 1 * 800 - 61) {
        $("#screenTwoMain").removeClass("screen-2__heading_animate_init").addClass("screen-2__heading_animate_done");      
        $("#navtip").css("left","120px");
        $("#sideNavCon").attr('class', 'outline outline_active_2');
        $("#srceenTwoSub").removeClass("screen-2__subheading_animate_init").addClass("screen-2__subheading_animate_done");      
        $("#srceenTwoPhone").removeClass("screen-2__phone_animate_init").addClass("screen-2__phone_animate_done");      
    }

    if (top > 2 * 800 - 61) {
        $("#headerCon").attr("class","header header_status_black header_active_3");
        $("#navtip").css("left","220px");
        $("#sideNavCon").attr('class', 'outline outline_active_3');
        
        $("#srceenThreeMain").removeClass("screen-3__heading_animate_init").addClass("screen-3__heading_animate_done");      
        $("#srceenThreeSub").removeClass("screen-3__subheading_animate_init").addClass("screen-3__subheading_animate_done");      
        $("#srceenThreePhone").removeClass("screen-3__phone_animate_init").addClass("screen-3__phone_animate_done");      
        $("#srceenThreeItems").removeClass("screen-3__features_animate_init").addClass("screen-3__features_animate_done");      
        
    }
    if (top > 3 * 800 - 61) {
        $("#navtip").css("left","320px");
        $("#headerCon").attr("class","header header_status_black header_active_4");
        $("#sideNavCon").attr('class', 'outline outline_active_4');

        $("#srceenFourMain").removeClass("screen-4__heading_animate_init").addClass("screen-4__heading_animate_done")
        $("#srceenFourSub").removeClass("screen-4__subheading_animate_init").addClass("screen-4__subheading_animate_done")
        $("#srceenFourType").removeClass("screen-4__type_animate_init").addClass("screen-4__type_animate_done")
    }
    if (top > 4 * 800 - 61) {
        $("#headerCon").attr("class","header header_status_black header_active_5");
        $("#navtip").css("left","420px");
        $("#sideNavCon").attr('class', 'outline outline_active_5');
        $("#srceenFiveMain").removeClass("screen-5__heading_animate_init").addClass("screen-5__heading_animate_done")
        $("#srceenFiveSub").removeClass("screen-5__heading_animate_init").addClass("screen-5__subheading_animate_done")
        $("#srceenFiveBack").removeClass("screen-5__back_animate_init").addClass("screen-5__back_animate_done"); 
    }
    
}) 
$("#sideNavCon").on("click","a",function(){
    var n = $(this).index();
    var topval = n>0?n*800 - 60: 0
    $("body").scrollTop(topval)
})
$("#navcon").on("click","a",function(){
    var n = $(this).index();
    var topval = n>0?n*800 - 60: 0
    $("body").scrollTop(topval)
})
$("#navcon").on("mouseover","a",function(){
    var n = $(this).index();
    var leftval = n>0?n * 100 + 20:20;
    $("#navtip").css("left",leftval)

})
       



    